<?php $this->load->view('templates/header') ?>
<?php $this->load->view('templates/nav') ?>
<div class="container">
<br>
<br>
<br>
<br>
<div class="row">
<?php if (isset($sidebar_list)): ?>
<?php $data['sidebar_list']=$sidebar_list;$this->load->view('templates/sidebar',$data) ?>
<?php endif; ?>
<div class="col-md-9 col-lg-9">

    <div class="row">
    <ol class="breadcrumb">
    <li><a href="#">Home</a></li>
    <li class="active" id="ncFlag">
    <?php if (isset($nc_flag)): ?>
    <?php echo $nc_flag; ?>
    <?php endif; ?>
    </li>
    </ol>
    </div>
    <div class="row">
        <?php if ( isset($nc_flag) && $nc_flag == 'nc_key'): ?>
        <?php echo form_open('nc/nc_check/nc_key') ?>
            <fieldset>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-1 control-label" for="key_bank_type">银行类型</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_bank_type" name="key_bank_type" /> </div>
                    <label class="col-sm-1 control-label" for="key_bank_name">银行名称</label>
                    <div class="col-sm-2"><select class="form-control" id="key_bank_name" name="key_bank_name">
                    <?php if(isset($bank_name)): ?>
                    <?php foreach($bank_name as $bank): ?>
                    <option><?php echo $bank;?></option>
                    <?php endforeach;?>
                    <?php endif; ?>
                    </select></div>
                    <label class="col-sm-1 control-label" for="key_user">KEY用户</label>            
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_user" name="key_user" /> </div>
                    <label class="col-sm-1 control-label" for="key_number">KEY编码</label>            
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_number" name="key_number" /> </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-1 control-label" for="key_cert_number">证书编码</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_cert_number" name="key_cert_number" /></div>
                    <label class="col-sm-1 control-label" for="key_keeper">保管员</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_keeper" name="key_keeper" /></div>
                    <label class="col-sm-1 control-label" for="key_cert_starttime">起始时间</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_cert_starttime" name="key_cert_starttime" /></div>           
                    <label class="col-sm-1 control-label" for="key_cert_endtime">到期时间</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_cert_endtime"  name="key_cert_endtime" /> </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-1 control-label" for="key_ip">部署IP</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_ip" name="key_ip" /></div>
                    <label class="col-sm-1 control-label" for="key_note">KEY备注</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="key_note" name="key_note" /></div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                    <div class="col-sm-offset-1 col-sm-11">
                        <button type="submit"  class="btn btn-primary">Search</button>                
                    </div>
                    </div>
                </div>
            </fieldset>
        </form>
        <?php elseif ( isset($nc_flag) && $nc_flag == 'nc_policy'): ?>
        <?php  echo form_open('nc/nc_check/nc_policy') ?>
            <fieldset>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-1 control-label" for="policy_bank_type">银行类型</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="policy_bank_type" name="policy_bank_type" /> </div>
                    <label class="col-sm-1 control-label" for="policy_bank_name">银行名称</label>
                    <div class="col-sm-2"><select class="form-control" id="policy_bank_name" name="policy_bank_name">
                    <?php if(isset($bank_name)): ?>
                    <?php foreach($bank_name as $bank): ?>
                    <option><?php echo $bank;?></option>
                    <?php endforeach;?>
                    <?php endif; ?>
                    </select></div>
                    <label class="col-sm-1 control-label" for="policy_bank_ip">银行IP</label>            
                    <div class="col-sm-2"><input type="text" class="form-control" id="policy_bank_ip" name="policy_bank_ip" /> </div>
                    <label class="col-sm-1 control-label" for="policy_bank_port">银行端口</label>            
                    <div class="col-sm-2"><input type="text" class="form-control" id="policy_bank_port" name="policy_bank_port" /> </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-1 control-label" for="policy_bank_proto">端口协议</label>
                    <div class="col-sm-2"><select class="form-control" id="policy_bank_proto" name="policy_bank_proto">
                    
                    <?php if(isset($bank_proto)): ?>
                    <?php foreach($bank_proto as $proto): ?>
                    <option><?php echo $proto;?></option>
                    <?php endforeach;?>
                    <?php endif; ?>
                    </select></div>
                    <label class="col-sm-1 control-label" for="policy_bank_idc">IDC机房</label>
                    <div class="col-sm-2"><select class="form-control" id="policy_bank_idc" name="policy_bank_idc">
                    <?php if(isset($bank_idc)): ?>
                    <?php foreach($bank_idc as $idc): ?>
                    <option><?php echo $idc;?></option>
                    <?php endforeach;?>
                    <?php endif; ?>
                    </select></div>
                    <label class="col-sm-1 control-label" for="policy_bank_nat">NAT地址</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="policy_bank_nat" name="policy_bank_nat" /></div>
                    <label class="col-sm-1 control-label" for="policy_bank_line">专线</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="policy_bank_line" name="policy_bank_line" /></div>
                    </div>
                </div>
                <div class="form-group">            
                    <div class="row">
                    <label class="col-sm-1 control-label" for="policy_bank_note">备注</label>
                    <div class="col-sm-2"><input type="text" class="form-control" id="policy_bank_note" name="policy_bank_note" /></div>
                    </div>
                </div>       
                <div class="form-group">
                    <div class="col-sm-offset-1 col-sm-11">
                        <button type="submit"  class="btn btn-primary">Search</button>                
                    </div>
                </div>
             </fieldset>
        </form>
        <?php elseif ( isset($nc_flag) && $nc_flag == 'nc_port'): ?>
        <?php echo form_open('nc/nc_check/nc_port') ?>
            <fieldset>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-2 control-label" for="nc_bank_type">NC银行类型</label>
                    <div class="col-sm-4"><input type="text" class="form-control" id="nc_bank_type" name="nc_bank_type" /> </div>
                    <label class="col-sm-2 control-label" for="nc_bank_name">NC银行名称</label>
                    <div class="col-sm-4"><select class="form-control" id="nc_bank_name" name="nc_bank_name">
                    <?php if (isset($bank_name)): ?>
                    <?php foreach($bank_name as $bank): ?>
                    <option><?php echo $bank;?></option>
                    <?php endforeach;?>
                    <?php endif; ?>
                    </select></div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                    <label class="col-sm-2 control-label" for="nc_listen_port">NC监听端口</label>            
                    <div class="col-sm-4"><input type="text" class="form-control" id="nc_listen_port" name="nc_listen_port" /> </div>
                    <label class="col-sm-2 control-label" for="nc_note">备注</label>            
                    <div class="col-sm-4"><input type="text" class="form-control" id="nc_note" name="nc_note" /> </div>
                    </div>
                </div>            
                <div class="form-group">
                    <div class="col-sm-offset-1 col-sm-11">
                        <button type="submit"  class="btn btn-primary">Search</button>                
                    </div>
                </div>
            </fieldset>
        </form>
        <?php endif; ?>
    </div><!--End row-->
    <div class="row">
    <div class="col-sm-12 col-md-12">
        <?php if ( isset($nc_flag) && $nc_flag=='nc_key'): ?> 
        <table id="keyTable" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>银行类型</th>
                    <th>银行名称</th>
                    <th>KEY用户</th>
                    <th>KEY编号</th>
                    <th>证书编号</th>
                    <th>起始日期</th>
                    <th>到期时间</th>
                    <th>保管员</th>
                    <th>部署IP</th>
                    <th>KEY备注</th>
                </tr>
            </thead>
            <tbody> 
            <?php if(isset($search_result)):?>
            <?php foreach($search_result as $item): ?>
                <tr>
                <td><?php echo $item['key_bank_type'] ?></td>
                <td><?php echo $item['key_bank_name'] ?></td>
                <td><?php echo $item['key_user'] ?></td>
                <td><?php echo $item['key_number'] ?></td>
                <td><?php echo $item['key_cert_number'] ?></td>
                <td><?php echo $item['key_cert_starttime'] ?></td>
                <td><?php echo $item['key_cert_endtime'] ?></td>
                <td><?php echo $item['key_keeper'] ?></td>            
                <td><?php echo $item['key_ip'] ?></td>
                <td><?php echo $item['key_note'] ?></td>
                </tr>
            <?php endforeach; ?>
            <?php endif;?>
            </tbody>
        </table>    
        <?php elseif ( isset($nc_flag) && $nc_flag=="nc_policy"): ?>
        <table id="policyTable" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>银行类型</th>
                    <th>银行名称</th>
                    <th>银行IP</th>
                    <th>银行端口</th>
                    <th>银行协议</th>
                    <th>IDC机房</th>
                    <th>NAT地址</th>
                    <th>专线</th>
                    <th>备注</th>
                </tr>
            </thead>
            <tbody> 
            <?php foreach($search_result as $item): ?>
                <tr>
                    <td><?php echo $item['policy_bank_type'] ?></td>
                    <td><?php echo $item['policy_bank_name'] ?></td>
                    <td><?php echo $item['policy_bank_ip'] ?></td>
                    <td><?php echo $item['policy_bank_port'] ?></td>
                    <td><?php echo $item['policy_bank_proto'] ?></td>
                    <td><?php echo $item['policy_bank_idc'] ?></td>
                    <td><?php echo $item['policy_bank_nat'] ?></td>
                    <td><?php echo $item['policy_bank_line'] ?></td>      
                    <td><?php echo $item['policy_bank_note'] ?></td>                  
                </tr>    
            <?php endforeach;?>
            </tbody>
        </table>
        <?php elseif ( isset($nc_flag) && $nc_flag=="nc_port"): ?>
        <table id="portTable" class="table_display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>NC银行类型</th>
                    <th>NC银行名称</th>
                    <th>NC监听端口</th>
                    <th>备注</th>
                </tr>
            </thead>
            <tbody> 
            <?php foreach($search_result as $item): ?>
                <tr>
                    <td><?php echo $item['nc_bank_type'] ?></td>
                    <td><?php echo $item['nc_bank_name'] ?></td>
                    <td><?php echo $item['nc_listen_port'] ?></td>
                    <td><?php echo $item['nc_note'] ?></td>                
                </tr>    
            <?php endforeach;?>
            </tbody>
        </table>
        <?php endif; ?>
    </div><!--End col-sm-12-->
    </div><!--End row-->
</div><!-- End col-md-9 col-lg-9-->
</div><!-- end row-->
</div><!-- end container-->
<!--<script src="<?php echo base_url() ?>assets/js/nc.js"></script>-->
<?php $this->load->view('templates/footer') ?>
